# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1069.1.205 -> 1.1069.154.1
#	arch/ia64/kernel/perfmon.c	1.7.1.18 -> 1.7.1.19
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/12/12	bjorn.helgaas@hp.com	1.1069.1.206
# Merge hp.com:/home/helgaas/linux/linux-2.4
# into hp.com:/home/helgaas/linux/ia64-extras
# --------------------------------------------
# 03/12/12	bjorn.helgaas@hp.com	1.1126
# Merge hp.com:/home/helgaas/linux/ia64-extras
# into hp.com:/home/helgaas/linux/linux-ia64-2.4
# --------------------------------------------
# 03/12/12	eranian@hpl.hp.com	1.1069.154.1
# ia64: Fix PFM_WRITE_PMCS failure in system-wide mode when PMC12 is zero
# 
#         - fixes a typo in pfm_write_pmcs() by which we were not using the
#           correct index variable to check for the default value of a PMC.
#           This caused calls to PFM_WRITE_PMCS to fail in system wide mode
#           when PMC12 is programmed to be zero.
# --------------------------------------------
#
diff -Nru a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
--- a/arch/ia64/kernel/perfmon.c	Fri Dec 12 16:27:45 2003
+++ b/arch/ia64/kernel/perfmon.c	Fri Dec 12 16:27:45 2003
@@ -1527,7 +1527,7 @@
 		 * 	- system-wide session: PMCx.pm=1 (privileged monitor)
 		 * 	- per-task           : PMCx.pm=0 (user monitor)
 		 */
-		if ((is_monitor || is_counting) && value != PMC_DFL_VAL(i) && PFM_CHECK_PMC_PM(ctx, cnum, value)) {
+		if ((is_monitor || is_counting) && value != PMC_DFL_VAL(cnum) && PFM_CHECK_PMC_PM(ctx, cnum, value)) {
 			DBprintk(("pmc%u pmc_pm=%ld fl_system=%d\n", 
 				cnum, 
 				PMC_PM(cnum, value),